<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //split([分隔符])把字符串按照指定的分隔符拆分成数组(和数组中join对应)
        //split支持正则
        let str = "music|movie|eat|sport"
        console.log(str.split('|').join(','));
    </script>
</body>

</html>